package cn.xiaoyu.su.service;

import cn.xiaoyu.su.controller.request.ConfirmOrderRequest;
import cn.xiaoyu.su.controller.request.OrderPageRequest;
import cn.xiaoyu.su.enums.ProductOrderPayTypeEnum;
import cn.xiaoyu.su.model.EventMessage;
import cn.xiaoyu.su.model.ProductOrderDO;
import cn.xiaoyu.su.util.JsonData;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ⼆当家⼩D
 * @since 2022-12-18
 */
public interface ProductOrderService {

    /**
     * 分页接口
     * @param orderPageRequest
     * @return
     */
    Map<String, Object> page(OrderPageRequest orderPageRequest);

    /**
     * 查询订单状态
     * @param outTradeNo
     * @return
     */
    String queryProductOrderState(String outTradeNo);

    /**
     * 下单
     * @param confirmOrderRequest
     * @return
     */
    JsonData confirmOrder(ConfirmOrderRequest confirmOrderRequest);

    /**
     * 定时关单
     * @param eventMessage
     * @return
     */
    boolean closeProductOrder(EventMessage eventMessage);

    /**
     * 处理微信回调通知
     * @param payTypeEnum
     * @param paramsMap
     */
    JsonData processOrderCallbackMsg(ProductOrderPayTypeEnum payTypeEnum, Map<String, String> paramsMap);

    /**
     * 处理队列里面的订单相关消息
     * @param eventMessage
     */
    void handleProductOrderMessage(EventMessage eventMessage);
}
